#pragma once

#include "../base/types.h"

OPEN_JLIB_NS


struct B64 {

  constexpr static uwl encode_hint (uwl len) noexcept {
    return ((len + 2) / 3) * 4;
  }

  constexpr static uwl decode_hint (uwl len) noexcept {
    return ((len + 3) / 4) * 3;
  }


  static uwl encode (void* dst, const void* src, uwl len, bool padding = true) noexcept;

  static uwl decode (void* dst, const void* src, uwl len) noexcept;
};


CLOSE_JLIB_NS